package com.bluenode.bounce;


import com.bluenode.bounce.util.*;

import android.app.*;
import android.opengl.*;
import android.os.*;

/**
 * An example full-screen activity that shows and hides the system UI (i.e.
 * status bar and navigation/system bar) with user interaction.
 * 
 * @see SystemUiHider
 */
public class CubeActivity extends Activity {
	private GLSurfaceView view;
	private CubeRenderer renderer;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// do something with SystemUiHider to have a view without SystemUi
		
		view = new GLSurfaceView(getApplication());
		view.setEGLContextClientVersion(2); // use GLES20
		
//		view.setEGLConfigChooser(new GLSurfaceView.EGLConfigChooser() {
//			public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
//				// Ensure that we get a 16bit framebuffer. Otherwise, we'll fall
//				// back to Pixelflinger on some device (read: Samsung I7500)
//				int[] attributes = new int[] { EGL10.EGL_DEPTH_SIZE, 16, EGL10.EGL_NONE };
//				EGLConfig[] configs = new EGLConfig[1];
//				int[] result = new int[1];
//				egl.eglChooseConfig(display, attributes, configs, 1, result);
//				return configs[0];
//			}
//		});

		renderer = new CubeRenderer(this);
		view.setRenderer(renderer);
		
		setContentView(view);
	}

	@Override
	protected void onPause() {
		super.onPause();
		view.onPause();
	}

	@Override
	protected void onResume() {
		super.onResume();
		view.onResume();
	}

}
